#include <stdio.h>
#include <assert.h>

static int is_palindrome(int num) {
  char buf[32];
  size_t len;

  len = snprintf(buf, sizeof(buf), "%d", num);
  assert(len < sizeof(buf));

  buf[len] = 0;

  int i;
  for (i = 0; i < len/2 + 1; i++) {
    if (buf[i] != buf[len-1-i])
      return 0;
  }

  return 1;
}

int main(int argc, char **argv) {
  int prod;

  int a, b;
  for (a = 100; a < 1000; a++) {
    for (b = 100; b < 1000; b++) {
      if (is_palindrome(a*b))
        printf("%d\n", a*b);
    }
  }
  return 0;
}
